package com.asset.dispoal.business.bsEvidenceRecognition;

import com.asset.dispoal.business.bsEvidenceRecognition.api.BusinessDataManageService;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.ContractEvidenceRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.ContractEvidenceResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.DeleteContractEvidenceRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceDeleteRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceListRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceListResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryFileRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryFileResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchHistoryResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.EvidenceMatchRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.IdCardRefreshHistoryCaseRequest;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.IdCardRefreshHistoryCaseResponse;
import com.asset.dispoal.business.bsEvidenceRecognition.dto.IdCardRefreshHistoryResponse;
import com.asset.dispoal.business.match.dto.MatchRequest;
import com.asset.dispoal.business.match.dto.RefreshCaseStateRequest;
import com.asset.dispoal.logger.annoation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

import java.util.List;
import java.util.Map;

/**
 * @author qr
 * @date 2022/5/10$
 */
@RestController
@Api(value = "证据管理", tags = "证据管理")
@RequestMapping("business/bsEvidenceRecognition")
public class BsEvidenceRecognitionController {

    @Autowired
    BusinessDataManageService businessDataManageService;

    @ApiOperation(value = "证据识别匹配", notes = "证据识别匹配")
    @PostMapping("evidenceIdentification")
    @SysLog(name = "证据识别匹配")
    public Result evidenceIdentification(@RequestBody EvidenceMatchRequest request) {
        return businessDataManageService.evidenceIdentification(request);
    }

    @ApiOperation(value = "证据匹配历史列表", notes = "证据匹配历史列表")
    @SysLog(name = "证据匹配历史列表")
    @GetMapping("/queryMatchHistory")
    public Result<PageVO<EvidenceMatchHistoryResponse>> queryMatchHistory(EvidenceMatchHistoryRequest request) {
        return businessDataManageService.queryMatchHistory(request);
    }

    @ApiOperation(value = "证据匹配历史详情列表", notes = "证据匹配历史详情列表")
    @SysLog(name = "证据匹配历史详情列表")
    @GetMapping("/queryMatchHistoryFile")
    public Result<PageVO<EvidenceMatchHistoryFileResponse>> queryMatchHistoryFile(EvidenceMatchHistoryFileRequest request) {
        return businessDataManageService.queryMatchHistoryFile(request);
    }


    @ApiOperation(value = "身份证刷新列表", notes = "身份证刷新列表")
    @SysLog(name = "身份证刷新列表")
    @GetMapping("/queryIdCardRefreshPage")
    public Result<PageVO<IdCardRefreshHistoryResponse>> queryIdCardRefreshPage(EvidenceMatchHistoryRequest request) {
        return businessDataManageService.queryIdCardRefreshPage(request);
    }

    @ApiOperation(value = "身份证刷新记录列表", notes = "身份证刷新记录列表")
    @SysLog(name = "身份证刷新记录列表")
    @GetMapping("/queryIdCardRefreshCasePage")
    public Result<PageVO<IdCardRefreshHistoryCaseResponse>> queryIdCardRefreshCasePage(IdCardRefreshHistoryCaseRequest request) {
        return businessDataManageService.queryIdCardRefreshCasePage(request);
    }

    @ApiOperation(value = "证据查看列表", notes = "证据查看列表")
    @SysLog(name = "证据查看列表")
    @GetMapping("queryEvidenceList")
    public Result<PageVO<EvidenceListResponse>> queryEvidenceList(EvidenceListRequest request) {
        return businessDataManageService.queryEvidenceList(request);
    }

    @ApiOperation(value = "单个合同的单个证据删除", notes = "单个合同的单个证据删除")
    @SysLog(name = "单个合同的单个证据删除")
    @GetMapping("/deleteSingleDataByContractId")
    public Result deleteSingleDataByContractId(DeleteContractEvidenceRequest request) {
        return businessDataManageService.deleteSingleDataByContractId(request);
    }

    @ApiOperation(value = "单个合同证据查询", notes = "单个合同证据查询")
    @SysLog(name = "单个合同证据查询")
    @GetMapping("/queryContractEvidenceById")
    public Result<List<ContractEvidenceResponse>> queryContractEvidenceById(ContractEvidenceRequest request) {
        return businessDataManageService.queryContractEvidenceById(request);
    }

    @ApiOperation(value = "证据列表删除", notes = "证据列表删除")
    @SysLog(name = "证据列表删除")
    @GetMapping("deleteEvidence")
    public Result deleteEvidence(EvidenceDeleteRequest request) {
        return businessDataManageService.deleteEvidence(request);
    }

    @ApiOperation(value = "回调", notes = "回调")
    @PostMapping("PythonCallback")
    @SysLog(name = "回调")
    public Result PythonCallback(@RequestBody MatchRequest request) {
        return businessDataManageService.evidenceMatchResult(request);
    }

    @ApiOperation(value = "回调", notes = "回调")
    @PostMapping("PythonCallback2")
    @SysLog(name = "回调")
    public Result PythonCallback2(@RequestBody Map map) {
        return businessDataManageService.evidenceMatchResult2(map);
    }

    @ApiOperation(value = "回调", notes = "回调")
    @PostMapping("PythonCallback3")
    @SysLog(name = "回调")
    public Result PythonCallback3(@RequestBody Map map) {
        return businessDataManageService.evidenceMatchResult3(map);
    }

    @ApiOperation(value = "回调", notes = "回调")
    @PostMapping("PythonCaseCallback")
    @SysLog(name = "回调")
    public Result PythonCaseCallback(@RequestBody MatchRequest request) {
        return businessDataManageService.evidenceCaseMatchResult(request);
    }

    @ApiOperation(value = "打包回调", notes = "打包回调")
    @PostMapping("/mergeCallBack")
    @SysLog(name = "打包回调")
    public Result mergeCallBack(@RequestBody MatchRequest matchRequest) {
        return businessDataManageService.mergeCallBack(matchRequest);
    }

    @ApiOperation(value = "身份证提取回调", notes = "身份证提取回调")
    @PostMapping("/idCardCallBack")
    @SysLog(name = "身份证提取回调")
    public Result idCardCallBack(@RequestBody MatchRequest request) {
        return businessDataManageService.idCardCallBack(request);
    }

    @ApiOperation(value = "地址提取回调", notes = "地址提取回调")
    @PostMapping("/addressCallBack")
    @SysLog(name = "地址提取回调")
    public Result addressCallBack(@RequestBody MatchRequest request) {
        return businessDataManageService.addressCallBack(request);
    }

    @ApiOperation(value = "刷新案件状态", notes = "刷新状态")
    @GetMapping("refreshCaseState")
    @SysLog(name = "刷新案件状态")
    public Result refreshCaseState(RefreshCaseStateRequest request) {
        return businessDataManageService.refreshCaseState(request);
    }
}
